import java.util.Scanner;

// 循环汉诺塔：动态规划找重复子问题
public class code3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int mod = 1000000007;
        int x =1,y = 2;
        for(int i=2;i<=n;i++) {
            int xx = x,yy=y;
            x= (2*yy+1) % mod;
            y = ((2*yy)%mod+2+xx)%mod;
        }
        System.out.print(x+" "+y);
    }
}